import CommentForm from '@components/CommentForm/CommentForm'; import CommentsList from '@components/CommentsList/CommentsList'; import { getLayout } from '@components/Layouts/Layout'; import PostFooter from '@components/PostFooter/PostFooter'; import PostHeader from '@components/PostHeader/PostHeader'; import Sharing from '@components/Sharing/Sharing'; import ToC from '@components/ToC/ToC'; import { t } from '@lingui/macro'; import { getAllPostsSlug, getPostBySlug } from '@services/graphql/queries'; import { NextPageWithLayout } from '@ts/types/app'; import { ArticleProps } from '@ts/types/articles'; import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import Head from 'next/head'; import { ParsedUrlQuery } from 'querystring'; const SingleArticle: NextPageWithLayout = ({ post }) => { const { author, comments, content, dates, intro, seo, subjects, thematics, title, } = post; return ( <> {seo.title}

{t`Comments`}

{t`Leave a comment`}

); }; SingleArticle.getLayout = getLayout; interface PostParams extends ParsedUrlQuery { slug: string; } export const getStaticProps: GetStaticProps = async ( context: GetStaticPropsContext ) => { const translation = await loadTranslation( context.locale!, process.env.NODE_ENV === 'production' ); const { slug } = context.params as PostParams; const post = await getPostBySlug(slug); const breadcrumbTitle = post.title; return { props: { breadcrumbTitle, post, translation, }, }; }; export const getStaticPaths: GetStaticPaths = async () => { const allSlugs = await getAllPostsSlug(); return { paths: allSlugs.map((post) => `/article/${post.slug}`), fallback: true, }; }; export default SingleArticle; >
path: root/public/prism/prism-fortran.js
blob: ff2d51cd42d9e5074d361b651fb9ef11e97519e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41